package com.qf;

/**
 * @author wgy
 * @version V1.0
 * @project maven-xiaomi-parent
 * @package com.qf
 * @company 千锋教育
 * @date 2024/6/15 11:35
 */
public class Factorial {
    public static int fac(int n){
        int fac=1;
        for (int i = 1; i <=n ; i++) {
            fac*=i;
        }
        return fac;
    }
    //其他方法

    public static int sum(int n){
        int sum=0;
        for (int i = 1; i <=n ; i++) {
            sum+=i;
        }
        return sum;
    }
}
